<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style type="text/css">
        body {
            margin: 0;
        }
        a {
            position: absolute;
            top: 0;
            left: 0;
            width: 100px;
            height: 100px;
            background-color: red;
            text-decoration: none;
        }
        div {
            display: none;
            position: absolute;
            top:0;
            left:0;
            width: 100px;
            height: 100px;
            background-color:greenyellow;
        }
    </style>
</head>
<body>
    <a href="javascript:;"></a>
    <div></div>
    <script type="text/javascript" src='js/utils.js'></script>
    <script type="text/javascript" src='js/index.js'></script>
    <script type="text/javascript">
       var oLink = document.getElementsByTagName('a')[0],
           oMenu = document.getElementsByTagName('div')[0];
        oLink.dragNClick(oMenu,function(){
            window.open('http://www.baidu.com');
        });
   </script>
</body>
</html>